package com.coolham.switter;

import com.coolham.switter.db.UserData;

import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;

public class SwitterApplication extends Application {
	private Context mContext;
	
	private UserData userData;
	private String mScreenName;
	
	public void onCreate() {
		super.onCreate();
		mContext = getBaseContext();
		
		initData();
	}
	
	private void initData() {
		userData = new UserData(mContext);
		if(!userData.isTableExits()) {
			userData.createTable();
		}
		
	}

	public void onTerminate() {
    	super.onTerminate();
    	userData.close();
    }
	
    public void onConfigurationChanged(Configuration newConfig) {
    }
    
    public void onLowMemory() {
    }

	public void setScreenName(String screenName) {
		this.mScreenName = screenName;
		
	}
	public String getScreenName() {
		return mScreenName;
	}
}
